<?php
declare (strict_types = 1);

namespace app\admin\controller;
use think\facade\View;
use think\facade\Config;
class Database
{
  public function index()
  {
    include_once(base_path().'../extend/qadmin.php');


    $adm = new \Qadmin();
    $adm->conf_driver = 'mysql';
    $adm->conf_dbhost = Config::get('database.connections.mysql.hostname');
    $adm->conf_dbname = Config::get('database.connections.mysql.database');
    $adm->conf_dbuser = Config::get('database.connections.mysql.username');        //
    $adm->conf_dbpass = Config::get('database.connections.mysql.password');    
    $adm->conf_dblock= true;            
    $adm->conf_dbmode= 'pdo'; 
    
    // print_r(Config::get('database.connections.mysql.password'));exit();

    $adm->conf_urlquery= 'b=';    
    $adm->conf_sidebar_close = true;     
    // $adm->conf_css  = 'csspath';       
    // $adm->conf_js   = 'jspath';        

    // $adm->conf_callback_func = 'myfunc';
    $adm->conf_debug = false;             
    

    return $adm->run();
  }
}
